# == Schema Information
# Schema version: 38
#
# Table name: areas
#
#  id        :integer(11)     not null, primary key
#  parent_id :integer(11)
#  lft       :integer(11)
#  rgt       :integer(11)
#  title     :string(255)
#  zipcode   :integer(11)
#

class Area < ActiveRecord::Base
  acts_as_nested_set
  
  has_many :schools
  
  validates_presence_of :title
  cattr_reader :disasters
  @@disasters = {"汶川" => 2330,
                 "都江堰" => 2186,
                 "旌阳" => 2219,
                 "梁平" => 2175,
                 "北川" => 2234,
                 "彭州" => 2187,
                 "绵竹" => 2222,
                 "什邡" => 2221,
                 "理县" => 2331,
                 "茂县" => 2332,
                 "江油" => 2228,
                 "青川" => 2240,
                 "安县" => 2231,
                 "平武" => 2233,
                 "甘肃文县" => 2894,
                 "甘肃甘南" => 2910}
end
